import {exportData} from './commom'
import {baseAjax} from '../baseAjax'

export function regionalListManageExport (data, fileName) {
  exportData('/ent/area/user/export', data, fileName)
}

// 分配销售给区域
export function allocateSaleToRegion (data, successHandle, failHandle) {
  baseAjax('/ent/area/user/config', data, 'put', successHandle, failHandle)
}

// 分配区域给销售
export function allocateRegionToSale (data, successHandle, failHandle) {
  baseAjax('/ent/area/user/config', data, 'put', successHandle, failHandle)
}

// 收回分配的区域
export function tackBackRegional (data, successHandle, failHandle) {
  baseAjax('/ent/area/user/config/delete', data, 'put', successHandle, failHandle)
}

// 根据区域Id获取区域详情
export function getRegionalDetailByIdReq (data, successHandle, failHandle) {
  let _url = `/ent/area/detail/${data}`
  baseAjax(_url, {}, 'GET', successHandle, failHandle)
}
